const Koa = require('koa');
const routes = require('./routes');
const app = new Koa();
const PORT = process.env.PORT || 3000;

//路由注册
Object.values(routes).forEach((route) => {
    app.use(route.routes()).use(route.allowedMethods());
});
app.listen(PORT, () => {
    console.info(`Server is running on port ${PORT}`);
});